<template>
  <div class="replaypart">
    <replaypartbar></replaypartbar>
    <list-dom :list='list'></list-dom>
    <icon-dom></icon-dom>
    <form-dom></form-dom>
  </div>
</template>
<script type="text/ecmascript-6">
import replaypartbar from "../../components/nav/replaypartbar";
import listDom from "../../components/replaypart/list";
import iconDom from "../../components/replaypart/iconFix";
import { getsupplybuylist } from "../../api/replay";
import formDom from "../../components/replaypart/alertBox";
export default {
    components: {
        replaypartbar,
        listDom,
        iconDom,
        formDom
    },
    data() {
        return {
            list: []
        };
    },
    computed: {
        type() {
            return this.$store.state.nocaches.replaypartObj;
        }
    },
    watch: {
        type: {
            handler(val, oldVal) {
                console.log(1111)
                this.getList(val);
            },
            deep: true
        }
    },
    methods: {
        getList(obj) {
            getsupplybuylist(obj).then(res => {
          
                if (res.code == "0000") {
                    this.list = res.data;
                }else if (res.code == "1100") {
                     this.list = [];
                }
            });
        }
    },
    created() {
        let obj = this.type;
        this.getList(obj);
    }
};
</script>
<style lang="less" scoped>
.replaypart {
    padding-bottom: 60px;
}
</style>

 